import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

const store = new Vuex.Store({
	state: {
		token: '',
		name: '',
		img: '',
		longitude: '',
		latitude: '',
		searchText: '',
		newBuildState:false

	},
	mutations: {
		setlongitude(state, data) {
			state.longitude = data
		},
		setlatitude(state, data) {
			state.latitude = data
		},
		setNewBuildState(state, data) {
			console.log(data);
			state.newBuildState = data
			console.log(state.newBuildState);
		},
		search(state, data) {
			state.searchText = data
		},
		login(state, data) { 
			state.token = data.token
		}
	}
})

export default store
